@using Blogifier.Shared.Resources
@using Blogifier.Shared
@using Microsoft.Extensions.Localization
@inject IStringLocalizer<Resource> _localizer
@{
   Layout = "layouts/_main.cshtml";
   ListModel listModel = (ListModel)Model;
}

<main class="container search">

    <form action="" method="GET">
        <input type="text" placeholder="Search...">
    </form>
    <h1 class="search-title">Search Results</h1>

    @if (listModel.Posts.Count() > 0)
    {
        @foreach (var post in listModel.Posts)
        {
            <div class="row mb-3">
                <div class="col-4">
                    <img src="~/@post.Cover" alt="@post.Title">
                </div>
                <div class="col-8">
                    <a href="~/posts/@post.Slug">@post.Title</a>
                    <p>@post.Description</p>
                </div>
            </div>
        }
    }

</main>
